<template>
  <form ref="form" >
  用户名:  <input type="username" v-model="form.username">
    密码： <input type="password" v-model="form.password">
    <hr>
  </form>
</template>
 
<script>
export default {
  name:'SonForm',
  data() {
    return {
      form: {
        username: '',
        password: ''
      }
    }
  },
  methods: {
    //在子组件内定义提交方法
    sonSubmit() {
      console.log(this.form.username, this.form.password)
      this.form.username = ''
      this.form.password = ''
    }
  }
}
</script>

<style scoped>
</style>